# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
pkgname=plasma-sdk
pkgver=6.0.4
pkgrel=0
pkgdesc="Applications useful for Plasma Development"
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
url="https://kde.org/plasma-desktop/"
license="GPL-2.0-or-later"
depends="kirigami"
makedepends="
	extra-cmake-modules
	karchive-dev
	kcompletion-dev
	kconfig-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	kdbusaddons-dev
	kdeclarative-dev
	kdoctools-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	kitemmodels-dev
	kparts-dev
	kservice-dev
	ksvg-dev
	ktexteditor-dev
	kwidgetsaddons-dev
	libplasma-dev
	plasma5support-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtsvg-dev
	samurai
	"
checkdepends="xvfb-run"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
subpackages="$pkgname-doc $pkgname-lang $pkgname-zsh-completion"
_repo_url="https://invent.kde.org/plasma/plasma-sdk.git"
source="https://download.kde.org/stable/plasma/$pkgver/plasma-sdk-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# iconmodeltest is broken
	xvfb-run -a ctest --test-dir build --output-on-failure -E "iconmodeltest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
ca150c1985950831fff091306281cf2aa7a6a60b75329af3187955532452a42bcb8baef3c2f7f736c32ef2a83e9a12fb49173571f3395154a4a34e7ed8b64442  plasma-sdk-6.0.4.tar.xz
"
